/*    */ package com.newcrm.util;
/*    */ 
/*    */ import java.util.ArrayList;
/*    */ import java.util.List;
/*    */ import org.xml.sax.Attributes;
/*    */ import org.xml.sax.SAXException;
/*    */ import org.xml.sax.SAXParseException;
/*    */ import org.xml.sax.helpers.DefaultHandler;
/*    */ 
/*    */ public class XMLHandler extends DefaultHandler
/*    */ {
/*    */   private static final String XML_TAG_ROW = "Row";
/*    */   private static final String XML_TAG_CELL = "Cell";
/* 16 */   private List<String[]> list = null;
/* 17 */   private List<String> row = new ArrayList();
/*    */ 
/* 19 */   private StringBuffer cellValue = new StringBuffer();
/*    */ 
/* 21 */   boolean isCell = false;
/*    */ 
/*    */   public XMLHandler(List<String[]> list) {
/* 24 */     this.list = list;
/*    */   }
/*    */ 
/*    */   public void startElement(String uri, String localName, String qName, Attributes attributes)
/*    */   {
/* 30 */     if ("Row".equals(qName)) {
/* 31 */       this.row = new ArrayList();
/* 32 */       return;
/*    */     }
/*    */ 
/* 36 */     if ("Cell".equals(qName)) {
/* 37 */       this.cellValue.delete(0, this.cellValue.length());
/* 38 */       this.isCell = true;
/*    */     }
/*    */   }
/*    */ 
/*    */   public void endElement(String uri, String localName, String qName)
/*    */     throws SAXException
/*    */   {
/* 45 */     if ("Row".equals(qName)) {
/* 46 */       this.list.add((String[])this.row.toArray(new String[0]));
/* 47 */       return;
/*    */     }
/*    */ 
/* 51 */     if ("Cell".equals(qName)) {
/* 52 */       this.isCell = false;
/* 53 */       this.row.add(this.cellValue.toString().trim());
/* 54 */       return;
/*    */     }
/*    */   }
/*    */ 
/*    */   public void characters(char[] ch, int start, int length) {
/* 59 */     if (!this.isCell) {
/* 60 */       return;
/*    */     }
/* 62 */     this.cellValue.append(ch, start, length);
/*    */   }
/*    */ 
/*    */   public void error(SAXParseException e)
/*    */     throws SAXException
/*    */   {
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.util.XMLHandler
 * JD-Core Version:    0.6.1
 */